<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/include/taglibs.jsp" %>
<html>
<head>
    <%@include file="/include/header.html" %>
    <script type="text/javascript" src="${ctx}/appjs/elec/hlhtOpenStation.js"></script>
    <script type="text/javascript"
            src="http://webapi.amap.com/maps?v=1.3&key=311ba5c2313d5b0f7286b55ef7109e3a"></script>
    <script type="text/javascript" src="${ctx}/libjs/plugins/bootstrap/js/bootstrap.AMapPositionPicker.js"></script>
</head>

<script type="text/javascript">
    $('#topLink', window.parent.document).html(function (i, origText) {
        return'<ol class="breadcrumb">' +
            '<li class="breadcrumb-item">' +
            '<a href="">主页</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a>开放站点</a>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<strong>站点详情</strong>' +
            '</li>' +
            '<li class="breadcrumb-item">' +
            '<a href="javascript:window.history.back()"><i class="fa fa-times"></i> 返回</a>' +
            '</li>' +
            '</ol>';
    });

</script>

<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <div class="columns pull-left">
                        <h5 class="font-bold">站点详情</h5>
                    </div>
                    <div class="ibox-tools">
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="addhlhtOpenStation">
                        <input id="elecStationId" name="elecStationId" value="${elecStation.elecStationId}"
                               type="hidden">


                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">站点名称：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="stationName" name="stationName" readonly
                                       value="${elecStation.stationName}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">站点类型：</label>
                            <div class="col-sm-8">
                                <select class="form-control" name="stationType" id="stationType" disabled>
                                    <option value="1"
                                            <c:if test="${elecStation.stationType eq '1'}">selected</c:if> >公共
                                    </option>
                                    <option value="50"
                                            <c:if test="${elecStation.stationType eq '50'}">selected</c:if> >个人
                                    </option>
                                    <option value="100"
                                            <c:if test="${elecStation.stationType eq '100'}">selected</c:if> >公交(专用)
                                    </option>
                                    <option value="101"
                                            <c:if test="${elecStation.stationType eq '101'}">selected</c:if> >环卫(专用)
                                    </option>
                                    <option value="102"
                                            <c:if test="${elecStation.stationType eq '102'}">selected</c:if> >物流(专用)
                                    </option>
                                    <option value="103"
                                            <c:if test="${elecStation.stationType eq '103'}">selected</c:if> >出租车(专用)
                                    </option>
                                    <option value="255"
                                            <c:if test="${elecStation.stationType eq '255'}">selected</c:if> >其他
                                    </option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">省-市-区：</label>
                            <div class="col-sm-2">
                                <select name="provinceId" id="provinceId" disabled
                                        class="form-control chosen-select"
                                        style="width: 100%" onchange="station.getCity()">
                                    <option value="" selected="selected">--请选择--</option>
                                    <c:forEach items="${provinces}" var="province">
                                        <option value="${province.provinceId}"
                                                <c:if test="${province.provinceId eq elecStation.provinceId}">selected</c:if>  >${province.provinceName}</option>
                                    </c:forEach>
                                </select>
                            </div>

                            <div class="col-sm-2">
                                <select name="cityId" id="cityId" disabled
                                        class="form-control chosen-select"
                                        style="width: 100%" onchange="station.getArea()">
                                    <option value="${elecStation.cityId}"
                                            selected="selected">${elecStation.cityName}</option>
                                </select>
                            </div>

                            <div class="col-sm-2">
                                <select id="areaId" name="areaId" class="form-control" placeholder="市区" disabled>
                                    <option value="${elecStation.areaId}"
                                            selected="selected">${elecStation.areaName}</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">地址详情：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="address" name="address" readonly
                                       value="${elecStation.address}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">营业类型：</label>
                            <div class="col-sm-8">
                                <select class="form-control" name="bizType" id="bizType" value="${elecStation.bizType}"
                                        disabled>
                                    <option value="0"
                                            <c:if test="${elecStation.bizType eq '0'}">selected</c:if> >自营
                                    </option>
                                    <option value="1"
                                            <c:if test="${elecStation.bizType eq '1'}">selected</c:if>  >非自营
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">开始营业时间：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="bizStartTime" name="bizStartTime" readonly
                                       value="${elecStation.bizStartTime}"/>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">结束营业时间：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="bizEndTime" name="bizEndTime" readonly
                                       value="${elecStation.bizEndTime}"/>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">纬度：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="latitude" name="latitude" readonly
                                       value="${elecStation.latitude}">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">经度：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="longitude" name="longitude" readonly
                                       value="${elecStation.longitude}">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">温馨提示：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="hint" name="hint" readonly
                                       value="${elecStation.hint}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">服务电话：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="servicePhone" name="servicePhone" readonly
                                       value="${elecStation.servicePhone}">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">是否免费停车：</label>
                            <div class="col-sm-8">
                                <select class="form-control" name="isFreeParking" id="isFreeParking" disabled>
                                    <option value="0"
                                            <c:if test="${elecStation.isFreeParking eq '0'}">selected</c:if>   >否
                                    </option>
                                    <option value="1"
                                            <c:if test="${elecStation.isFreeParking eq '1'}">selected</c:if>   >是
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">是否专用车位：</label>
                            <div class="col-sm-8">
                                <select class="form-control" name="isSpecialParking" id="isSpecialParking" disabled>
                                    <option value="0"
                                            <c:if test="${elecStation.isSpecialParking eq '0'}">selected</c:if>   >是
                                    </option>
                                    <option value="1"
                                            <c:if test="${elecStation.isSpecialParking eq '1'}">selected</c:if>   >否
                                    </option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">停车备注：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" id="parkingRemark" name="parkingRemark" readonly
                                       value="${elecStation.parkingRemark}">
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">图片1：</label>
                            <div class="col-sm-8">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${elecStation.stationImg1!=null && elecStation.stationImg1!=''}">
                                            <div id="">
                                                <img id="stationImg1" src="${uploadPath}${elecStation.stationImg1}"
                                                     width="155px" height="120px">
                                                <input hidden name="stationImg1">
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="stationImg1" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input hidden name="stationImg1">
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">图片2：</label>
                            <div class="col-sm-8">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${elecStation.stationImg2!=null && elecStation.stationImg2!=''}">
                                            <div id="">
                                                <img id="stationImg2" src="${uploadPath}${elecStation.stationImg2}"
                                                     width="155px" height="120px">
                                                <input hidden name="stationImg2">
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="stationImg2" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input hidden name="stationImg2">
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">图片3：</label>
                            <div class="col-sm-8">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${elecStation.stationImg3!=null && elecStation.stationImg3!=''}">
                                            <div id="">
                                                <img id="stationImg3" src="${uploadPath}${elecStation.stationImg3}"
                                                     width="155px" height="120px">
                                                <input hidden name="stationImg3">
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="stationImg3" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input hidden name="stationImg3">
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">图片4：</label>
                            <div class="col-sm-8">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${elecStation.stationImg4!=null && elecStation.stationImg4!=''}">
                                            <div id="">
                                                <img id="stationImg4" src="${uploadPath}${elecStation.stationImg4}"
                                                     width="155px" height="120px">
                                                <input hidden name="stationImg4">
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="stationImg4" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input hidden name="stationImg4">
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-sm-3 col-form-label text-right">图片5：</label>
                            <div class="col-sm-8">
                                <div id="">
                                    <c:choose>
                                        <c:when test="${elecStation.stationImg5!=null && elecStation.stationImg5!=''}">
                                            <div id="">
                                                <img id="stationImg5" src="${uploadPath}${elecStation.stationImg5}"
                                                     width="155px" height="120px">
                                                <input hidden name="stationImg5">
                                            </div>
                                        </c:when>
                                        <c:otherwise>
                                            <div id="">
                                                <img id="stationImg5" src="${ctx}/statics/img/upload-img.png"
                                                     style="position: relative" width="155px" height="120px">
                                                <input hidden name="stationImg5">
                                            </div>
                                        </c:otherwise>
                                    </c:choose>
                                </div>
                                <span>图片尺寸建议为：<span class="text-danger">98px*75px</span></span>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    /*地图选择经纬度*/
    var p = $("#id_address_input").AMapPositionPicker();
    $("#id_get_data").on('click', function () {
        var s = JSON.stringify(p.AMapPositionPicker('position'));
        var parse = JSON.parse(s);
        var longitude = parse.longitude;
        var latitude = parse.latitude;
        $("#longitude").val(longitude)
        $("#latitude").val(latitude)
    });

</script>
</body>
</html>
